<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>径向渐变</title>
    <style>
        .box1{
            width: 200px;
            height: 200px;
            border: 5px solid gray;
            /* 指的0%-10%是红色开始渐变  指的10%-30%是绿色开始渐变 超过30%是蓝色*/
            background: radial-gradient(red 0%, green 10%, blue 30%);
        }
        .box2{
            width: 300px;
            height: 100px;
            border: 5px solid gray;
            margin-top: 10px;
            /* circle:渐变的形状(圆形) 按照最长边变化 */
            background: -webkit-radial-gradient(60% 40%,closest-side,red, green, blue);
        }
    </style>
</head>
<body>
    <div class="box1"></div>
    <div class="box2"></div>
</body>
</html>